#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QAction>
#include <QMenu>
#include <QMenuBar>
#include <QToolBar>
#include <QIcon>
#include <QMessageBox>

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{

//    ui->setupUi(this);
    openAction = new QAction(tr("&Open"), this);
    openAction->setShortcut(QKeySequence::Open);
    openAction->setStatusTip(tr("Open a file"));
    openAction->setIcon(QIcon(":/images/FileOpen16.png"));


    QMenu *file = menuBar()->addMenu(tr("&File"));
    file->addAction(openAction);

    QToolBar *toolBar = addToolBar(tr("&File"));
    toolBar->addAction(openAction);

    connect(openAction, SIGNAL(triggered()), this, SLOT(open()));


}

void MainWindow::open()
{
    QMessageBox::information(NULL, tr("Open"), tr("Open a file"));

}

MainWindow::~MainWindow()
{
    delete ui;
}
